#ifndef _SERVER_CFG_H_
#define _SERVER_CFG_H_

#include "extension-base-class.h"

class server_cfg
{
public:
    server_cfg();
    ~server_cfg();

    bool set_sip_server_cfg(std::string &str_sip_id, std::string &str_sip_domain, std::string &str_sip_host, unsigned short us_sip_port, std::string &str_password);
    bool get_sip_server_cfg(std::string &str_sip_id, std::string &str_sip_domain, std::string &str_sip_host, unsigned short &us_sip_port, std::string &str_password);
    bool get_sip_server_sip_info(std::string &str_sip_id, std::string &str_sip_domain);
    bool get_sip_server_host(std::string &str_sip_host, unsigned short &us_sip_port);
    bool get_sip_server_unified_access_password(std::string &str_password);

    bool set_media_server_cfg(std::string &str_ip, unsigned short us_port);
    bool get_media_server_cfg(std::string &str_ip, unsigned short &us_port);

private:
    std::mutex mo_mutex;

    //SIP ID: 34020000002000000001
    std::string mstr_sip_server_codeid;

    //SIP域: 3402000000
    std::string mstr_sip_server_domain;

    //SIP服务IP地址:192.168.....
    std::string mstr_sip_host;

    //SIP端口:35061
    unsigned short mus_sip_port;

    //设备统一接入密码: 12345678
    std::string mstr_dev_unified_access_password;

    //流媒体服务器IP地址及端口
    std::string mstr_media_server_ip;
    unsigned short mus_media_server_port;
};

typedef singleton_locker_factory<server_cfg> singleton_lock_sip_server_cfg_handler;

#endif
